/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author lzw
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface Contract extends BasicModel<Contract> {
  contractName?: string; // 合同名称
  jf?: string; // 甲方
  yf?: string; // 乙方
  bf?: string; // 丙方
}

export const contractList = (params?: Contract | any) =>
  defHttp.get<Contract>({ url: adminPath + '/operating/contract/list', params });

export const contractListData = (params?: Contract | any) =>
  defHttp.post<Page<Contract>>({ url: adminPath + '/operating/contract/listData', params });

export const contractForm = (params?: Contract | any) =>
  defHttp.get<Contract>({ url: adminPath + '/operating/contract/form', params });

export const contractSave = (params?: any, data?: Contract | any) =>
  defHttp.postJson<Contract>({ url: adminPath + '/operating/contract/save', params, data });

export const contractDelete = (params?: Contract | any) =>
  defHttp.get<Contract>({ url: adminPath + '/operating/contract/delete', params });
